package com.binarycat.dynamiclimit.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.binarycat.dynamiclimit.bean.LimitPolicyEnum;

/**
 * @author jjb
 * @date 2018/08/06
 */
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface DynamicLimit {

    /**
     * 是否根据Ip限流(默认不需要)
     * 
     * @return
     */
    public boolean limitByIp() default false;

    /**
     * 是否开启限流(默认开启)
     * 
     * @return
     */
    public boolean value() default true;

    public LimitPolicyEnum limitPolicy() default LimitPolicyEnum.ALL_POLICY_LIMIT;

}
